package com.onemore.task.model;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.voovan.tools.log.Logger;

import com.alibaba.fastjson.JSONObject;
import com.onemore.task.JdbcGlobal;

public class ModelGeneral extends JdbcGlobal{
	final static private String fields[] = new String[] {"SyncBillId","BILLOUTDATE","QTYIN","SL"};

    static public List<Map<String, Object>> getCompareList(String sql) throws SQLException
    {
    	List<Map<String, Object>> manyMaps = null;
		manyMaps = getJdbcOperate().queryMapList(sql);
		return manyMaps;
    }

	static public boolean isNotExist()
	{
		return validateTableExist("ONE_WMS");
	}
    static public void createTable() throws SQLException
    {
    	String sql = "CREATE TABLE [dbo].[ONE_WMS] (\r\n" + 
    			"[BillId] varchar(30) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT '' ,\r\n" + 
    			"[syncbillid] varchar(30) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT '' ,\r\n" + 
    			"[billdate] char(10) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT '' ,\r\n" + 
    			"[QTYIN] int NOT NULL DEFAULT ((0)) ,\r\n" + 
    			")";
//		"PRIMARY KEY ([BillId])\r\n" + 
    	getJdbcOperate().update(sql);
    }
}
